<template>
	<view class="ss-coupon-menu-wrap ss-flex ss-col-center">
		<!-- <view class="menu-item ss-flex-col ss-row-center ss-col-center" v-for="item in props.list" :key="item.title"
			@tap="sheep.$router.go(item.path, { type: item.type })"
			:class="item.type === 'all' ? 'menu-wallet' : 'ss-flex-1'">
			<image class="item-icon" :src="sheep.$url.static(item.icon)" mode="aspectFit"></image>
			<view class="menu-title ss-m-t-28">{{ item.title }}</view>
		</view> -->
		<view class="two">
			<view class="two_box">
				<view class="">
					<view class="">
						今日总收益
					</view>
					<view class="two_b" style="color: #E84010;">
						￥{{userInfo.today_income}}
					</view>
				</view>
				<image :src="sheep.$url.static('static/today_m.png')" mode=""></image>
			</view>
			<view class="line"></view>
			<view class="two_box">
				<view class="">
					<view class="">
						累计总收益
					</view>
					<view class="two_b" style="color: #FC8E23;">
						￥{{userInfo.all_income}}
					</view>
				</view>
				<image :src="sheep.$url.static('static/total_m.png')" mode=""></image>
			</view>
		</view>
	</view>
</template>

<script setup>
	/**
	 * 装修组件 - 优惠券菜单
	 */
	import sheep from '@/sheep';
	import {
		computed,
		reactive
	} from 'vue';
	const userInfo = computed(() => sheep.$store('user').userInfo);
	// 接收参数
	const props = defineProps({
		list: {
			type: Array,
			default () {
				return [
					{
					  title: '已领取',
					  value: '0',
					  icon: '/assets/addons/shopro/uniapp/order/nouse_coupon.png',
					  path: '/pages/coupon/list',
					  type: 'geted',
					},
					{
					  title: '已使用',
					  value: '0',
					  icon: '/assets/addons/shopro/uniapp/order/useend_coupon.png',
					  path: '/pages/coupon/list',
					  type: 'used',
					},
					{
					  title: '已失效',
					  value: '0',
					  icon: '/assets/addons/shopro/uniapp/order/out_coupon.png',
					  path: '/pages/coupon/list',
					  type: 'expired',
					},
					{
					  title: '领券中心',
					  value: '0',
					  icon: '/assets/addons/shopro/uniapp/order/all_coupon.png',
					  path: '/pages/coupon/list',
					  type: 'all',
					},
				];
			},
		},
	});
	
</script>

<style lang="scss" scoped>
	.ss-coupon-menu-wrap {
		.two {
			background: #fff;
			border-radius: 20rpx;
			width: 100%;
			display: flex;
			height: 160rpx;
			border: 2rpx solid #f8f8f9;
			margin: 0 auto;
			box-shadow: 0 0 8rpx 16rpx rgba(0, 0, 0, .1);

			.line {
				width: 2rpx;
				height: 50rpx;
				margin-top: 58rpx;
				background-color: #D9D9D999;
			}

			.two_box {
				width: 48%;
				display: flex;
				align-items: center;
				padding: 30rpx;
				justify-content: space-between;
				color: #1D1B20;
				font-size: 28rpx;

				view {
					padding: 6rpx 0;
				}

				.two_b {
					font-size: 26rpx;
				}

				image {
					height: 76rpx;
					width: 76rpx;
				}
			}
		}
		
		.menu-item {
			height: 160rpx;

			.menu-title {
				font-size: 28rpx;
				line-height: 60rpx;
				color: #000;
				.box{
					line-height: 60rpx;
				}
				.price{
					color:#E84010;
					line-height: 40rpx;
				}
				.line {
					width: 2rpx;
					height: 50rpx;
					margin-top: 58rpx;
					background-color: #D9D9D999;
				}
			}

			.item-icon {
				margin-left: 40rpx;
				width: 76rpx;
				height: 76rpx;
			}
		}

		.menu-wallet {
			width: 144rpx;
		}
	}
</style>